package com.cyx.netty.gateway.support;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.FullHttpRequest;

import java.util.Map;
import java.util.Optional;

public interface ServerWebExchange {

  FullHttpRequest getRequest();

  /**
   * Return the current HTTP response.
   */
//  FullHttpResponse getResponse();
  ChannelHandlerContext getChannelHandlerContext();
  /**
   * Return a mutable map of request attributes for the current exchange.
   */
  Map<String, Object> getAttributes();

  /**
   * Return the request attribute value if present.
   * @param name the attribute name
   * @param <T> the attribute type
   * @return the attribute value
   */
  <T> Optional<T> getAttribute(String name);




}
